package com.eliaukjq.xunlianying.duoxianchengjichu;

import java.util.concurrent.TimeUnit;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2024/7/20 - 18:01
 */
public class TestThread1 extends Thread {
    @Override
    public void run() {
        try {
            Thread.sleep(20000);
            System.out.println("Thread run");
        } catch (InterruptedException e) {
            e.printStackTrace();
            System.out.println("catch:" + Thread.currentThread().isInterrupted());
        }
    }

    public static void main(String[] args) throws InterruptedException {
        TestThread1 thread1 = new TestThread1();
        thread1.start();
        TimeUnit.SECONDS.sleep(2);
//        thread1.interrupt();
    }
}